#include "dlm.h"
#include "stdio.h"

#ifdef OS_Linux
char* fx_cb = "{ \"mod\": \"libdl2.so\", \"fx\": \"numerial_calculate\", \"argv\": {\"a\": 7, \"b\": 31} }";
#endif
#ifdef OS_Cygwin
char* fx_cb = "{ \"mod\": \"cygdl2.dll\", \"fx\": \"numerial_calculate\", \"argv\": {\"a\": 7, \"b\": 31} }";
#endif

struct  __dynamic_function_pool FxPool;

int main(int argc, char* argv[])
{
	fx_pool_construct(&FxPool);
#ifdef OS_Linux
	load_dynamic_module("libdl2.so", &FxPool);
#endif
#ifdef OS_Cygwin
	load_dynamic_module("cygdl2.dll", &FxPool);
#endif

	fx_pool_list(&FxPool);

	char fx_retval[1024];
	FX_TRIGGER(fx_cb, fx_retval, &FxPool);
	printf("%s\n", fx_retval);
	
	fx_pool_release(&FxPool);
}